home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.19970929-19971216 / 000228_news@newsmaster….columbia.edu _Sun Nov 2 08:55:50 1997.msg < prev    next >
Internet Message Format  |  2020-01-01  |  17KB

  1. Return-Path: <news@newsmaster.cc.columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.35.30])
  3.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id IAA19263
  4.     for <kermit.misc@watsun.cc.columbia.edu>; Sun, 2 Nov 1997 08:55:50 -0500 (EST)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id IAA07878
  7.     for kermit.misc@watsun; Sun, 2 Nov 1997 08:55:49 -0500 (EST)
  8. Path: news.columbia.edu!sol.ctr.columbia.edu!spool.mu.edu!uwm.edu!vixen.cso.uiuc.edu!logbridge.uoregon.edu!dispose.news.demon.net!demon!news.demon.co.uk!demon!fangorn.demon.co.uk!news
  9. From: adrian@fangorn.demon.co.uk (Adrian Godwin)
  10. Newsgroups: comp.protocols.kermit.misc
  11. Subject: Re: Problem with TRANSMIT / Linux 2.0.27 / Redhat 4.1
  12. Date: 30 Oct 1997 01:15:01 -0000
  13. Organization: Adrian's rest home for middle-aged electronics
  14. Message-ID: <638n2l$h6n@fangorn.fangorn.demon.co.uk>
  15. References: <637i8i$n87$1@apakabar.cc.columbia.edu>
  16. NNTP-Posting-Host: localhost.fangorn.demon.co.uk
  17. X-NNTP-Posting-Host: fangorn.demon.co.uk [158.152.8.130]
  18. Lines: 239
  19. Xref: news.columbia.edu comp.protocols.kermit.misc:8008
  20.  
  21. In article <637i8i$n87$1@apakabar.cc.columbia.edu>
  22. fdc@watsun.cc.columbia.edu (Frank da Cruz) wrote:
  23.  
  24. > You know, of course, that the TRANSMIT command is a last resort, to be
  25. > used when an error-checking-and-correcting protocol is not available, and
  26. > that it is very likely to result in corrupted or missing data at the
  27. > receiving end, right?
  28.  
  29. I do. That's why I'm using it to bootstrap a hex-encoded kermit server into
  30. a DS5000 microcontroller that has only a hex file reader in its boot rom.
  31.  
  32.  
  33. > : I suppose I can't be totally sure of the reliability of the serial
  34. > : port, PC chipsets and UARTS being what they are.
  35. > :
  36. > You might have answered your own question right there.
  37.  
  38. I might, though I'm a bit surprised that I haven't seen any problems in the 
  39. other uses of the port if it's an especially unreliable one. Problems in
  40. the driver might be another matter, since its use by PPP is probably a 
  41. lot different to its use by kermit.
  42.  
  43.  
  44. > : set file type { text / bin }
  45. > :       ( the number of characters lost varies slightly )
  46. > :
  47. > If you read the manual, you'll see that this also makes a difference in
  48. > the number of characters sent.
  49.  
  50. Well, that's why I tried it : I wanted to see if some extra CRs would
  51. change the number of characters buffered and hence affect the
  52. behaviour.  In fact, I got a result which surprised me : because I didn't
  53. set TRANSMIT LINEFEED ON, the number of characters sent to the driver
  54. were actually the same (though CR was substituted for LF) BUT the
  55. characters transmitted differed .. typically one character less of the 
  56. final line was sent in text mode.
  57.  
  58. > : enabling local echo
  59. > :       ( the whole file is echoed to the screen, but not sent to the
  60. > :         line. There's another effect too : echo only works in binary
  61. > :         mode, not text )
  62. > :
  63. > The relevant command is "set transmit echo on".
  64.  
  65. And "set terminal echo on", and especially "set transmit prompt 0". 
  66. I used all these, but since I was trying various things out, probably
  67. not consistently enough.  Anyway, I tried to repeat what I thought I'd 
  68. seen, using a script for consistency, and I couldn't - so I guess I was 
  69. wrong.  Sorry.
  70. The only object of enabling echo was to find out whether the lossage
  71. was due to the characters not being sent, or the file not being read.
  72. It did at least prove that the file was all being read.
  73.  
  74.  
  75. > : Any further suggestions gratefully received.
  76. > :
  77. > Read the manual?  There is a whole chapter on the TRANSMIT command and
  78. > how to control it.  If you have accounted correctly for the
  79.  
  80. I did that (for that chapter, at least) I wouldn't dare post here without :-).
  81.  
  82. > characteristics of the thing that you are transmitting to and have given
  83. > all the appropriate SET TRANSMIT commands, as well as the necessary
  84. > communications-related commands -- speed, parity, flow control, etc --
  85. > and you still have this problem, then supply all of the details and
  86. > settings and we'll take a more detailed look.
  87.  
  88. For test purposes, there is no other unit : the serial cable has 
  89. handshaking looped back and there's just a protocol analyser to examine
  90. the data. It's a bit old, but it has no problem with 19200 bps.
  91.  
  92. > Or you might just try cranking the connection down to a lower speed.
  93.  
  94. Speed changing was interesting. I tried initially at 19200. I got the
  95. same, or very similiar results at 1200 and even at 300. The effect of
  96. speed changes is more noticeable in binary mode : i.e. characters are
  97. usually lost, but in binary mode higher speeds seem to cause wider
  98. variations.
  99.  
  100. What did change the behaviour drastically was "transmit pause". Any
  101. non-zero setting would completely fix the problem in binary mode, but
  102. at the cost of severely limiting througput (probably due to a minimum
  103. useful value for msleep on this hardware). Below 12, the problem in
  104. text mode was not affected. At 12, the problem was fixed for text, too.
  105.  
  106. All this makes me think that the problem is due to the way buffering is
  107. handled in the driver : if the file ends (and the tty mode is restored) 
  108. with data still buffered, some may be lost. The way to test this would
  109. probably be to INCREASE the speed, so the UART can serialise data faster
  110. than Kermit can send it. But I can't reliably check output above 19200.
  111.  
  112. I have read somewhere a description of a problem with flushing Linux
  113. serial buffers, timeouts, closing files etc., but I can't find it now.
  114. It's not in the serial 'howto', or the device driver source - if this
  115. rings a bell with anyone, I'd like to know.
  116.  
  117. Here's a script that illustrates the problem, and all the details of
  118. running it.  Unfortunately, it may be machine-speed dependent, I
  119. suppose. For what it's worth, this machine is a 100MHz PCI 486. I
  120. appreciate that some lines (like set file type text) are redundant in
  121. the scripts as shown, but they illustrate some of the settings I've 
  122. played around with.
  123.  
  124.  
  125. show fea
  126. show ver
  127. set line /dev/cua0
  128. set sp 300
  129. set flow none
  130.  
  131. set file type text
  132. set transmit prompt 0
  133. set transmit echo on
  134. set terminal echo on
  135. set file type bin
  136. ; set transmit pause 12
  137.  
  138. ; If enabled, this string is sometimes partially sent 
  139. ; ( just like the last line of the real file ) 
  140. ; set transmit eof <end-of-file>
  141.  
  142. show transmit 
  143. xmit example.hex
  144.  
  145.  
  146. This was the result of executing 
  147.  
  148.   'kermit -y test.ksc >test.lis' 
  149.  
  150. (this build has no 'log debug'). The file dump at the beginning is the
  151. result of enabling echo, but appears first in the output. I did try to
  152. get a copy of the actual transmitted output by looping TXD back to RXD,
  153. but it doesn't really make a useful trace : stdout isn't meant for this
  154. sort of use!
  155.  
  156. On this occasion, the file was truncated 3 characters short of the end :
  157. the last line transmitted was
  158.  
  159. <LF>:00000001
  160.  
  161. with no final FF<LF>.
  162.  
  163.  
  164. -adrian
  165.  
  166.  
  167.  
  168.  
  169. :03000000020038C3
  170. :03000B000200CD23
  171. :100030000D0A50726F62650075810F1200B61200D2
  172. :10004000541200E2D2AF9000301200B19000301292
  173. :10005000011F80FE758DFD758BFF53890F4389202D
  174. :10006000438840759850438780D29922209807E5AD
  175. :1000700022B401F8D322C298E599C3223099FDC277
  176. :1000800099F59922C0E0C4118ED0E0118E22540F50
  177. :1000900024028380E7303132333435363738394102
  178. :1000A0004243444546740D117C740A117C22117C34
  179. :1000B000A3E49370F922758C00758A005389F0438C
  180. :1000C0008901D28C752164752201D2A922758AFF1B
  181. :1000D000758CDBD28CD52109752164D5220375225C
  182. :1000E000013285FF9074103124741031247413315F
  183. :1000F00024740D312474803124752000740431245B
  184. :10010000740E3124781474203127D8FA22B40A02EC
  185. :1001100080E3B40D1274807520008008310DA3E4D3
  186. :100120009370F922C380190520D33140E520B40A29
  187. :100130000474C080EFB41407752000748080E52239
  188. :1001600090316640FC22C296C297C294D294C29447
  189. :08017000A293D29485FF9022B6
  190. :00000001FF
  191.  
  192. Major optional features included:
  193.  Network support (type SHOW NET for further info)
  194.  Hardware flow control
  195.  External XYZMODEM protocol support
  196.  Latin-1 (West European) character-set translation
  197.  Latin-2 (East European) character-set translation
  198.  Cyrillic (Russian, Ukrainian, etc) character-set translation
  199.  Hebrew character-set translation
  200.  Kanji (Japanese) character-set translation
  201.  REDIRECT command
  202.  RESEND command
  203.  Fullscreen file transfer display
  204.  Control-character unprefixing
  205.  
  206. Major optional features not included:
  207.  No debugging
  208.  
  209. Compiled Mar 14 1997 16:13:51, options:
  210.  TLOG BIGBUFOK XFRCAN CK_SPEED CK_APC CK_AUTODL CK_MKDIR WHATAMI DYNAMIC
  211.  CMDDEP=64 CKMAXPATH=1023 MAXGETPATH=128 CMDBL=4072 VNAML=64 ARRAYREFLEN=128
  212.  FORDEPTH=10 MAXTAKE=32 MACLEVEL=64 MAC_MAX=256 MSENDMAX=100 MAXDDIR=32
  213.  MAXDNUMS=4095 UNIX DIRENT RENAME CK_TMPDIR CK_TTYFD NETCONN TCPSOCKET
  214.  SOL_SOCKET TDP_NODELAY RLOGCODE CONGSPD SELECT NOFILEH NOSETBUF NOKVERBS
  215.  _POSIX_SOURCE __linux__ POSIX i386 __STDC__ __GNUC__ CK_ANSIC CK_ANSILIBS
  216.  _POSIX_JOB_CONTROL CK_POSIX_SIG CK_CURSES CK_NEWTERM CK_WREFRESH CK_PCT_BAR
  217.  CK_RTSCTS POSIX_CRTSCTS CK_DSYSINI CK_SYSINI CK_INI_A CK_TTGWSIZ CK_NAWS
  218.  DCMDBUF CK_RECALL CK_TIMERS
  219.  
  220.  
  221. Versions:
  222.  C-Kermit 6.0.192, 6 Sep 96
  223.  Numeric: 600192
  224.  Patches: 
  225.     01 (handle-old-timestamps)
  226.     05 (keep-packets-inside-window)
  227.     06 (move-from-send-list-should-delete)
  228.     08 (handle-spaces-in-command-line-filename)
  229.     15 (make-xecho-flush-output)
  230.     17 (linux-posix-hispeed)
  231.     18 (fix-shell-wildcard-expansion)
  232.  UNIX Communications support, 6.0.169, 6 Sep 96 for Linux
  233.  UNIX File support, 6.0.115 6 Sep 96 for Linux
  234.  C-Kermit Protocol Module 6.0.095, 6 Sep 96
  235.  C-Kermit functions, 6.0.133, 6 Sep 96
  236.  Command package 6.0.088, 6 Sep 96
  237.  User Interface 6.0.177, 6 Sep 96
  238.  Character Set Translation 6.0.024, 4 Jul 96
  239.  CONNECT Command for UNIX, 6.0.083, 6 Sep 96
  240.  Dial Command, 6.0.091, 6 Sep 96
  241.  Script Command, 6.0.028, 8 Feb 96
  242.  Network support, 6.0.078, 6 Sep 1996
  243.  
  244.  File type: binary
  245.  See SHOW CHARACTER-SETS for character-set info
  246.  Terminal echo: local
  247.  Transmit EOF: none
  248.  Transmit Fill: none
  249.  Transmit Linefeed: off
  250.  Transmit Prompt: none
  251.  Transmit Echo: on
  252.  Transmit Locking-Shift: off
  253.  Transmit Pause: 0 milliseconds
  254. From news@newsmaster.cc.columbia.edu  Sun Nov  2 11:42:51 1997
  255. Return-Path: <news@newsmaster.cc.columbia.edu>
  256. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.35.30])
  257.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id LAA11143
  258.     for <kermit.misc@watsun.cc.columbia.edu>; Sun, 2 Nov 1997 11:42:51 -0500 (EST)
  259. Received: (from news@localhost)
  260.     by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id LAA16096
  261.     for kermit.misc@watsun; Sun, 2 Nov 1997 11:42:50 -0500 (EST)
  262. Path: news.columbia.edu!watsun.cc.columbia.edu!fdc
  263. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  264. Newsgroups: comp.protocols.kermit.misc,comp.os.linux.misc
  265. Subject: Re: Problem with TRANSMIT / Linux 2.0.27 / Redhat 4.1
  266. Date: 2 Nov 1997 16:42:42 GMT
  267. Organization: Columbia University
  268. Lines: 107
  269. Message-ID: <63iai2$icp$1@apakabar.cc.columbia.edu>
  270. References: <637i8i$n87$1@apakabar.cc.columbia.edu> <638n2l$h6n@fangorn.fangorn.demon.co.uk>
  271. NNTP-Posting-Host: watsun.cc.columbia.edu
  272. Xref: news.columbia.edu comp.protocols.kermit.misc:8009 comp.os.linux.misc:223653
  273.  
  274. In article <638n2l$h6n@fangorn.fangorn.demon.co.uk>,
  275. Adrian Godwin <adrian@fangorn.demon.co.uk> wrote:
  276. : In article <637i8i$n87$1@apakabar.cc.columbia.edu>
  277. : fdc@watsun.cc.columbia.edu (Frank da Cruz) wrote:
  278. : > You know, of course, that the TRANSMIT command is a last resort, to be
  279. : > used when an error-checking-and-correcting protocol is not available, and
  280. : > that it is very likely to result in corrupted or missing data at the
  281. : > receiving end, right?
  282. : I do. That's why I'm using it to bootstrap a hex-encoded kermit server into
  283. : a DS5000 microcontroller that has only a hex file reader in its boot rom.
  284. (etc etc)...  I'd be really surprised if the TRANSMIT command did not send
  285. exactly the characters it was told to send -- otherwise I'd have heard about
  286. it by now, in spades, and in any case this is a fairly stable chunk of code
  287. that has barely changed at all in years -- so if transmitted characters are
  288. not coming out the port, then the driver or the port hardware are the most
  289. likely culprits.
  290.  
  291. There has been a lot of talk recently about Linux drivers -- e.g. the
  292. ttyS devices versus the cu devices.  Have you tried using a different driver
  293. for the same device?
  294.  
  295. : > : I suppose I can't be totally sure of the reliability of the serial
  296. : > : port, PC chipsets and UARTS being what they are.
  297. : > :
  298. : > You might have answered your own question right there.
  299. : I might, though I'm a bit surprised that I haven't seen any problems in the 
  300. : other uses of the port if it's an especially unreliable one. Problems in
  301. : the driver might be another matter, since its use by PPP is probably a 
  302. : lot different to its use by kermit.
  303. Wouldn't PPP hide errors from you by repeatedly forcing retransmission of
  304. damaged material until it gets through correctly?
  305.  
  306. : > : enabling local echo
  307. : > :       ( the whole file is echoed to the screen, but not sent to the
  308. : > :         line. There's another effect too : echo only works in binary
  309. : > :         mode, not text )
  310. : > :
  311. :
  312. : > The relevant command is "set transmit echo on".
  313. : And "set terminal echo on", and especially "set transmit prompt 0". 
  314. :
  315. Note that when C-Kermit echos transmitted material, these are exactly the
  316. same characters that it sends to the port.  So if they are not coming out
  317. the port -- and the driver is not reporting an error -- something is badly
  318. amiss under the hood.
  319.  
  320. : Speed changing was interesting. I tried initially at 19200. I got the
  321. : same, or very similiar results at 1200 and even at 300. The effect of
  322. : speed changes is more noticeable in binary mode : i.e. characters are
  323. : usually lost, but in binary mode higher speeds seem to cause wider
  324. : variations.
  325. Hmmm...  If you look at the code (transmit() in ckuus4.c) you'll see that
  326. completely different sections of code are used for text and binary mode.
  327. Therefore if both of them fail for you, the chance that BOTH sections of code
  328. are faulty is pretty slim.
  329.  
  330. Binary mode should not have to be used for transmitting an ordinary text
  331. file, and especially not for transmitting one like this -- Intel Hex files
  332. are just about the most transportable files on earth -- restricted safe
  333. character set, short lines, etc.
  334.  
  335. : What did change the behaviour drastically was "transmit pause". Any
  336. : non-zero setting would completely fix the problem in binary mode, but
  337. : at the cost of severely limiting througput (probably due to a minimum
  338. : useful value for msleep on this hardware). Below 12, the problem in
  339. : text mode was not affected. At 12, the problem was fixed for text, too.
  340. This is fairly clear evidence that the driver is allowing its output buffer
  341. to be overrun.   It's a good thing C-Kermit has so many controls, eh?
  342. Btw, TRANSMIT PAUSE applies per character in binary mode, and per line in
  343. text mode (as you knew, or discovered).
  344.  
  345. : Here's a script that illustrates the problem, and all the details of
  346. : running it.  Unfortunately, it may be machine-speed dependent, I
  347. : suppose.
  348. :
  349. Well, as far as Kermit is concerned, the speed doesn't matter.  The same
  350. code is being executed at any speed, and the same bytes are being sent;
  351. it's up to the driver to actually send them, and to take care of realtime
  352. considerations like flow control, kernel buffering, checking the UART's
  353. ready and overflow flags, etc.  In any case, your hex file transmits 
  354. perfectly here in text mode.
  355.  
  356. : For what it's worth, this machine is a 100MHz PCI 486.
  357. :
  358. Beyond the driver, on any PC you need to be aware of buffered versus
  359. unbuffered UART and interrupt conflict issues.
  360.  
  361. In any case, since this is a one-time-only bootstrapping operation, and
  362. you seem to have a workaround, I think we can consider the case closed as
  363. far as C-Kermit is concerned.  Unless there is something wrong amongst the
  364. many ioctls given to the driver to condition it for transmitting; these
  365. are done in the ttpkt() routine in ckutio.c, and have worked fine in Linux
  366. for many years, but again, C-Kermit can't see which driver you are using
  367. -- it can only issue the appropriate and documented API calls and expect
  368. them to work as advertised.  However, if any Linux expert wants to take a
  369. look and suggest corrections, perhaps based on changes in the APIs that
  370. I don't know about, feel free!
  371.  
  372. - Frank